<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function sleep(interval) {
        return new Promise(resolve => {
            setTimeout(resolve, interval);
    })
    }

    // 用法
    async function one2FiveInAsync() {
        for(let i = 1; i <= 5; i++) {
            console.log(i);
            await sleep(1000);
        }
    }

    one2FiveInAsync();
    console.log("6666")
</script>

</body>
</html>